//
// Created by fanghr on 17-12-25.
//

#ifndef PROJECT_SHM_H
#define PROJECT_SHM_H

#include "../include.h"

class shm {
public:
    shm(std::string name, size_t size);

    void changeSize(size_t size);

    void *get();

    void lock();
    void unlock();
private:
    std::string name;
    boost::interprocess::named_mutex mutex;
    boost::interprocess::shared_memory_object shm_obj;
    boost::interprocess::mapped_region map;
};


#endif //PROJECT_SHM_H
